﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Core.Module.Interfaces.Controller;
using Core.Module.Interfaces.Manager;
using Core.Module.Interfaces.Model;
using Microsoft.Practices.Unity;
using Core.Module.Interfaces;


namespace Core.Module.Controller
{
    public class SiteController : ISiteController<IFrontend>
    {
        #region Properties        
        [Dependency]
        public ISiteManager<IFrontend> Manager { get; set; }
        #endregion
                
        public List<ISite> Get()
        {
            return Manager.Get();                
        }        

        public ISite Get(string siteId)
        {
            int sid;
            if (!int.TryParse(siteId, out sid)) return null;
            return Manager.Get(sid);
        }

        public ISite Get(IModuleNode siteNode)
        {
            return Manager.Get(siteNode);            
        }

    }
}
